#!/usr/bin/env python

#==============================================================================
# Functionality
#==============================================================================
import pdb
import json

# utility funcs, classes, etc go here.

def asserting(cond):
    if not cond:
        pdb.set_trace()
    assert(cond)

#==============================================================================
# Cmdline
#==============================================================================
import argparse

parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, 
    description="""
TODO
""")
     
parser.add_argument('-v', '--verbose',
    action="store_true",
    help="verbose output" )
     
parser.add_argument('-o', '--out',
    help="output file" )

args = None

def _startup():
    global args
    if not args:
        args, leftovers = parser.parse_known_args()
        args.args = leftovers
    return args

#==============================================================================
# Main
#==============================================================================
import sys
import os

def run():
    if args.verbose:
        print args
    has_stdin = not sys.stdin.isatty()
    # if there were no args and there was no input, prompt user.
    if not has_stdin and len(args.args) <= 0:
        print 'Paste some tweets: '
        print ''
    process(sys.stdin.read())

def main():
    _startup()
    return run()

if __name__ == "__main__":
    main()

